//
//  ViewController.m
//  16_UICollectionViewCycleImage
//
//  Created by 徐昊 on 16/8/4.
//  Copyright © 2016年 徐昊. All rights reserved.
//

#import "ViewController.h"
#import "HXCycleImages.h"
@interface ViewController ()<HXCycleImagesDelegate, HXCycleImagesCellDelegate>
@property (weak, nonatomic) IBOutlet HXCycleImages *cycleImage;

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view, typically from a nib.
    NSMutableArray *array = [NSMutableArray array];
    for (int i = 0; i < 5; i++) {
        [array addObject:[NSString stringWithFormat:@"%d.jpg", i]];
    }
    NSString *firstImage = [array firstObject];
    NSString *lastObject = [array lastObject];
    [array insertObject:lastObject atIndex:0];
    [array addObject:firstImage];
    _cycleImage.delegate = self;
    _cycleImage.datasource = self;
    _cycleImage.array = array;
}
- (void)currentCell:(HXCycleImagesCell *)cell index:(NSIndexPath *)index {
    NSLog(@"打死了%ld个曹曹", index.row);
    cell.label.text = @"打死曹曹";
}
- (void)cycleView:(HXCycleImages *)view {
    view.frame = CGRectMake(0, 0, 300, 500);
}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}


@end
